package edu.snake.implement.factory;

import edu.snake.core.model.Position;
import edu.snake.implement.model.arena.PositionImpl;

import static edu.snake.implement.Utils.requireNonNull;

public class PositionFactory {
    public static synchronized Position getNewPosition(int width, int height) {
        return new PositionImpl(width, height);
    }

    public static synchronized Position getNewPosition(Position position) {
        requireNonNull(position, "Position must be specified, when create new Position [PositionFactory.getNewPosition(Position position)]");
        return new PositionImpl(position.getWidth(), position.getHeight());
    }
}